<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no,minimal-ui">
    <title>宠物商城</title>

    <!--<link rel="stylesheet" href="../../static/os/css/index.css" th:href="@{/os/css/index.css}" />-->
    <!--<link rel="stylesheet" href="../../static/os/css/base.css" th:href="@{/os/css/base.css}" />-->
    <!--<link rel="stylesheet" href="../../static/os/css/main.css" th:href="@{/os/css/main.css}" />-->
    <!--<link rel="stylesheet" href="../../static/common/bootstrap/css/bootstrap.min.css" th:href="@{/common/bootstrap/css/bootstrap.min.css}" />-->
    <!--<script src="../../static/os/js/index.js" th:href="@{/os/js/index.js}"></script>-->

    <link rel="stylesheet" href="../../static/layui/css/layui.css" th:href="@{/layui/css/layui.css}"/>
    <link href="../../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet" type="text/css"/>
    <link href="../../static/css/common.css" th:href="@{/css/common.css}" rel="stylesheet" type="text/css"/>
    <link href="../../static/css/custom.css" th:href="@{/css/custom.css}" rel="stylesheet" type="text/css"/>
    <script src="../../static/layui/jquery-3.2.1.min.js" th:src="@{/layui/jquery-3.2.1.min.js}"></script>
    <script src="../../static/layui/layui.js" th:src="@{/layui/layui.js}"></script>
    <!--<script src="../../static/layui/layui.all.js" th:src="@{/layui/layui.all.js}"></script>-->

</head>
<body class="W-body line-mo-body">
<!--
    这里包含了每个页面的公共模块
-->
<!--头部 导航条模块-->
<div class="layui-header header" th:fragment="head">
    <script>
        //        <![CDATA[
        var layer;
        layui.use(["layer","element"],function () {
            layer = layui.layer;
        });
        //JavaScript代码区域
        //        ]]>
    </script>

    <div class="layui-main">
        <ul class="layui-nav">
            <li class="layui-nav-item">
                <a href="/mall/index.html"><i class="layui-icon layui-icon-html"></i> 宠物商店</a>
            </li>
            <li class="layui-nav-item"><a target="_blank" href="/mall/zx.html">资讯</a></li>
            <li class="layui-nav-item"><a target="_blank" href="/mall/ke.html">宠物课堂</a></li>
            <li class="layui-nav-item">
                <script>
                    //                    <![CDATA[
                    //加载分类
                    $.get("/mall/admin/classification/getType.do?type=1&pageindex=-1", function (data) {
                        if (data.state == 0) {
                            var list = $("#category");
                            $(data.data).each(function (index, item) {
                                var cat = $("<dd><a href='/mall/product/category.html?cid="+item.id+"'>" + item.cname + "</a></dd>");
                                list.append(cat);
                            })
                        } else {
                            alert(data.message);
                        }
                    });
                    //                    ]]>
                </script>
                <a href="/mall/product/so.do?word=医生">宠物医生</a>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;">宠物相关</a>
                <dl class="layui-nav-child"> <!-- 二级菜单 -->
                    <dd><a href="/mall/product/so.do?word=宠物">宠物领养</a></dd>
                    <dd><a href="/mall/product/so.do?word=寄养">宠物寄养</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;">帮助</a>
                <dl class="layui-nav-child"> <!-- 二级菜单 -->
                    <dd><a href="/mall/seller/toRegister.html">注册开店</a></dd>
                    <dd><a href="/mall/seller/toLogin.html">店铺登录</a></dd>
                    <dd><a href="#">关于我们</a></dd>
                </dl>
            </li>

            <li class="layui-nav-item" style="color:#393D49;">
                <a href="javascript:;">分类</a>
                <dl class="layui-nav-child" id="category">

                </dl>
                <script>
                    //                    <![CDATA[
                    //加载分类
                    $.get("/mall/admin/classification/list.do?type=1&pageindex=-1", function (data) {
                        if (data.state == 0) {
                            var list = $("#category");
                            $(data.data).each(function (index, item) {
                                var cat = $("<dd><a href='/mall/product/category.html?cid="+item.id+"'>" + item.cname + "</a></dd>");
                                list.append(cat);
                            })
                        } else {
                            alert(data.message);
                        }
                    });
                    //                    ]]>
                </script>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <i class="fa fa-user-circle"></i>&nbsp;
                    <span th:if="${session.user == null}">请登陆</span>
                    <span th:if="${session.user != null}" th:text="'欢迎您!&nbsp;' + ${session.user.username}">请登陆</span>
                </a>
                <dl class="layui-nav-child">
                    <dd th:if="${session.user != null}"><a href="/mall/user/logout.do"><i class="fa fa-sign-out"></i> 退出登录</a></dd>
                    <dd th:if="${session.user != null}"><a href="/mall/order/toList.html"><i class="fa fa-list"></i> 我的订单</a></dd>
                    <dd th:if="${session.user != null}"><a href="/mall/product/toCart.html"><i class="fa fa-shopping-cart"></i> 购物车</a></dd>
                    <dd th:if="${session.user == null}"><a href="/mall/user/toLogin.html"><i class="fa fa-sign-in"></i> 登录</a></dd>
                    <dd th:if="${session.user == null}"><a href="/mall/user/toRegister.html"><i class="fa fa-user-plus"></i> 注册</a></dd>
                </dl>
            </li>
        </ul>

    </div>




</div>






<script type="text/javascript">
    $("profile").attr("href","/mall/user/toEdit.html")
</script>



<!--底部模块-->
<div class="footer footer-index" th:fragment="foot">
    <hr style="color: #c2c2c2;" />
    <!-- 底部固定区域 -->
    © Allen 2019
    <a href="/mall/admin/toLogin.html">后台管理系统</a>
</div>

</body>
</html>
